const mainhost = 'cnwbip.com';
const local = {
  serveraddress: `http://qxt.${mainhost}/admin`,
  pcSiteUrl: 'http://localhost/zngongyeqxt',
  searchSiteUrlPrefix: 'http://localhost/zngongyeqxtsearch',
  urlprefix: '/',
  webpack_public_path: '/',
  trade_login_url: `http://admin.${mainhost}/logout`,
};

const prd = {
  serveraddress: `http://qxt.${mainhost}/admin`,
  pcSiteUrl: 'http://47.103.39.8/zngongyeqxt',
  searchSiteUrlPrefix: 'http://47.103.39.8/zngongyeqxtsearch',
  urlprefix: '/',
  webpack_public_path: './',
  trade_login_url: `http://admin.${mainhost}/logout`,
};

// 通过前缀判断环境
// eslint-disable-next-line import/no-mutable-exports
let config = local;

// eslint-disable-next-line no-undef
if (location.href.indexOf('localhost') > -1) {
  config = local;
} else {
  config = prd;
}

export default config;
